package basic.xiazheng;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @创建人 MBY381
 * @创建时间 2022/4/8 15:04
 * @描述 暂无
 */
public class DateBoard {
    public static void date1() {
        Date a = new Date();
        System.out.println(a.toString());
        Date time = new Date(System.currentTimeMillis());
        System.out.println("Date(long milliseconds):   " + time.toString());
        time.setTime(System.currentTimeMillis() + 100000);
        System.out.println("setTime():  " + time);
        System.out.println(a.getTime() == System.currentTimeMillis());
        a = (Date) time.clone();
        System.out.println(a);
    }

    public static void dateformat() {
        SimpleDateFormat ft = new SimpleDateFormat("G yy-MM-dd HH:mm  S E  D");
        Date date = new Date();
        System.out.println(ft.format(date));

    }

    public static void main(String[] args) {
        date1();
        dateformat();

    }
}
